import { computed } from 'vue';
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';

export const columns = (t: (key: string) => string) => {
  return computed<TableColumnData[]>(() => [
    {
      title: t('searchTable.columns.index'),
      dataIndex: 'id',
      slotName: 'id',
      align: 'center',
    },
    {
      title: t('searchTable.columns.user_uuid'),
      dataIndex: 'user_uuid',
      slotName: 'user_uuid',
      align: 'center',
    },
    {
      title: t('searchTable.columns.user_name'),
      dataIndex: 'user_name',
      slotName: 'user_name',
      align: 'center',
      width: 80,
    },
    {
      title: t('searchTable.columns.user_nick_name'),
      dataIndex: 'user_nick_name',
      slotName: 'user_nick_name',
      align: 'center',
    },
    {
      title: t('searchTable.columns.user_email'),
      dataIndex: 'user_email',
      align: 'center',
    },
    {
      title: t('searchTable.columns.user_mobile'),
      dataIndex: 'user_mobile',
      slotName: 'user_mobile',
      align: 'center',
    },
    {
      title: t('searchTable.columns.company_name'),
      dataIndex: 'company_name',
      align: 'center',
    },
    {
      title: t('searchTable.columns.address'),
      dataIndex: 'address',
      align: 'center',
      width: 120,
    },
    {
      title: t('searchTable.columns.role_name'),
      dataIndex: 'role_name',
      align: 'center',
    },
    {
      title: t('searchTable.columns.role_code'),
      dataIndex: 'role_code',
      align: 'center',
    },
    {
      title: t('searchTable.columns.state'),
      dataIndex: 'state',
      slotName: 'state',
      align: 'center',
    },
    {
      title: t('searchTable.columns.operations'),
      dataIndex: 'operations',
      slotName: 'operations',
      align: 'center',
      fixed: 'right',
      width: 180,
    },
  ]);
};
